﻿<UserControl x:Class="Gui.Controls.Toolbox"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:vm="clr-namespace:Gui.ViewModels"
             mc:Ignorable="d" 
             d:DesignHeight="50" d:DesignWidth="300">
    <UserControl.DataContext>
        <vm:ToolboxViewModel />
    </UserControl.DataContext>

    <Grid>
        <ListView ItemsSource="{Binding Cities}" SelectedIndex="{Binding SelectedIndex}" >
            <ListView.ItemsPanel>
                <ItemsPanelTemplate>
                    <WrapPanel Width="{Binding (FrameworkElement.ActualWidth), RelativeSource={RelativeSource AncestorType=ScrollContentPresenter}}"
    				   ItemWidth="{Binding (ListView.View).ItemWidth, RelativeSource={RelativeSource AncestorType=ListView}}"
    				   MinWidth="{Binding ItemWidth, RelativeSource={RelativeSource Self}}"
    				   ItemHeight="{Binding (ListView.View).ItemHeight, RelativeSource={RelativeSource AncestorType=ListView}}" />
                </ItemsPanelTemplate>
            </ListView.ItemsPanel>
        </ListView>
 </Grid>
</UserControl>
